<!--{if !defined('IN_AJAX')}-->
{template modoer_header}
<script type="text/javascript" src="{URLROOT}/static/javascript/item.js"></script>
<script type="text/javascript" src="{URLROOT}/static/javascript/swfobject.js"></script>
<style type="text/css">@import url("{URLROOT}/{$_G[tplurl]}css_review.css");</style>
<div id="body">
<div class="myhead"></div>
<div class="mymiddle">
	<div class="myleft">
		<!--{template 'menu','member','member'}-->
	</div>
	<div class="myright">
		<div class="myright_top"></div>
		<div class="myright_middle">
			<h3>
				{if $ac=='edit'}编辑点评{else}添加点评{/if}
				{if !$user->isLogin}(游客){/if}
			</h3>
<!--{/if}-->
			<div class="mainrail" id="review_foot">
			<!--{if $ac=='add' && !$id}-->
				<table width="100%" cellspacing="0" cellpadding="0" class="maintable">
					<tr>
						<td width="100" align="right">搜索点评对象：</td>
						<td width="*">
							<div id="subject_search"></div>
							<script type="text/javascript">
								$('#subject_search').item_subject_search({
									input_class:'t_input',
									btn_class:'btn2',
									result_css:'item_search_result',
									hide_keyword:true,
									city_id:$_CITY['aid'],
									location:"{url review/member/ac/add/type/item_subject/id/_SID_}",
									appendhtml:{
										html:"<li><a href=\"{url item/member/ac/subject_add}\"><span class=\"font_1\">以上都不是，我要添加新主题</span></li>",
										inlist:true
									}
								});
							</script>
						</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td><div id="search_result" style="display:none;"></div></td>
					</tr>
				</table>
			<!--{else}-->
				<form method="post" name="frm_review" id="frm_review" action="{url review/member/ac/$ac/in_ajax/$_G[in_ajax]/rand/$_G[random]}">
				<input type="hidden" name="review[idtype]" value="$idtype" />
				<input type="hidden" name="review[id]" value="$id" />
				<input type="hidden" name="review[subject]" value="$subject" />
				<table width="100%" cellspacing="0" cellpadding="0" {if !$_G[in_ajax]}class="maintable" width="600"{else}class="item_table"{/if}>
					<!--{if !$_G[in_ajax]}-->
					<tr>
						<td width="100" align="right">点评对象：</td>
						<td width="*"><a href="{url $typeinfo[flag]/detail/id/$id}" target="_blank">$subject</a></td>
						<td>&nbsp;</td>
					</tr>
					<!--{/if}-->
					<tr>
						<td align="right"><span class="font_1">*</span>总体评价：</td>
						<td>{print form_radio('review[best]',array(2=>'好',1=>'一般',0=>'不好'),$detail['best']?$detail['best']:2)}</td>
					</tr>
					<tr>
						<td width="100" align="right" valign="top"><span class="font_1">*</span>评价分数：</td>
						<td width="*">
							<!--{loop $review_opts $key $val}-->
							<div class="review-rating">
								<div class="rating-name">$val[name]<span class="font_3" id="review_$val[flag]_v">(好)</span></div>
								<div class="rating-start"><input type="hidden" name="review[{$val[flag]}]" id="review_$val[flag]"></div>
							</div>
							<!--{/loop}-->
							<script type="text/javascript">
								<!--{loop $review_opts $key $val}-->
								<!--{eval $rating = $detail[$val[flag]] ? $detail[$val[flag]] : (int)$MOD[default_grade];}-->
								$("#review_$val[flag]").review_rating({
									rating_initial_value: '$rating',
									rating_function_name: 'review_rating',
									directory: urlroot+'/static/images/rating/'
								});
								<!--{/loop}-->
							</script>
						</td>
					</tr>
					<tr>
						<td align="right">点评标题：</td>
						<td><input type="text" name="review[title]" class="t_input" size="40" value="$detail[title]" /></td>
					</tr>
					<!--{if $config[voice_review]}-->
					<tr>
						<td align="right"></td>
						<td>
							<input type="hidden" name="review[voice_file]" value="$detail[voice_file]" />
							<div id="voice_div" style="position:relative;"></div>
							<span id="voice_upload_btn" class="update-img-ico"><a href="javascript:;" onclick="review_voice_ui($id);">上传语音文件</a></span>
							<span class="font_3">上传语音点评时，点评内容可以不填写。</span>
							{if $detail[voice_file]}
							<script type="text/javascript">review_voice_add('voice_div','$detail[voice_file]');</script>
							{/if}
						</td>
					</tr>
					<!--{/if}-->
					<tr>
						<td align="right"></td>
						<td>
							<div class="review_picture_upload">
								<!--{if $config[use_review_upload_pic]}-->
								<span class="update-img-ico"><a href="javascript:;" onclick="review_pic_ui($id);">上传点评图片</a></span>
								<!--{/if}-->
								<div id="review_picture" style="margin-top:5px;">
									<!--{if $detail[pictures]}-->
									<!--{eval $detail[pictures] = unserialize($detail[pictures]);}-->
									<!--{loop $detail[pictures] $picid $pic}-->
									<div id="pic_{$picid}_foo" class="review_picture_op">
										<input type="hidden" name="review[pictures][]" id="pic_$picid" value="$pic[picture]" />
										<a href="{URLROOT}/$pic[picture]" target="_blank"><img src="{URLROOT}/$pic[thumb]" /></a>
										<a href="javascript:;" onclick="$('#pic_{$picid}_foo').remove();">删除</a>
									</div>
									<!--{/loop}-->
									<!--{/if}-->
								</div>
							</div>
							<div class="clear"></div>
						</td>
					</tr>
					<tr>
						<td align="right" valign="top">
							<span class="font_1">*</span>点评内容：<br />
						</td>
						<td>
							<textarea name="review[content]" style="{if $_G[in_ajax]}width:400px;{else}width:90%;{/if}height:120px;padding:5px;" onkeyup="record_charlen(this,$MOD[review_max],'review_content');">$detail[content]</textarea>

							<div class="font_1">请将点评内容限制在 $MOD[review_min] - $MOD[review_max] 个字符以内，当前输入：<span id="review_content" class="font_1">{print strlen($detail[content])}</span></div>

							<div class="review_tool">
								<!--{if $ac == 'add'}-->
									<!--{eval
										$sharelist = array('weibo','txweibo','facebook');
										$pstoken = $_G['loader']->model('member:passport')->get_token_status($user->uid);
										$_G['session']->token_forword = request_uri();
									}-->
									<ul class="passport_share">
										<li><span class="lable">同步到</span></li>
										<!--{loop $sharelist $tk}-->
										<li>
											<input type="checkbox" name="share[$tk]" value="1" id="share_$tk" {if !$pstoken[$tk]}disabled="disabled"{/if} />
											{if $pstoken[$tk]}
												<label for="share_$tk"><img src="{URLROOT}/static/images/passport/{$tk}_n.png" />{print lang('member_passport_type_'.$tk)}</label>
											{elseif isset($pstoken[$tk])}
												<a href="{url member/index/ac/passport/op/get_token/nop/token/psname/$tk}" title="点击更新授权"><img src="{URLROOT}/static/images/passport/{$tk}_d.png" target="_blank" />{print lang('member_passport_type_'.$tk)}</a>
											{else}
												<a href="{url member/index/ac/passport/op/get_token/nop/bind/psname/$tk}" title="点击绑定账号"><img src="{URLROOT}/static/images/passport/{$tk}_d.png" target="_blank" />{print lang('member_passport_type_'.$tk)}</a>
											{/if}
										</li>
										<!--{/loop}-->
									</ul>
									<div class="clear"></div>
								<!--{/if}-->
							</div>
						</td>
					</tr>
					<!--{if $config['useprice']}-->
					<tr>
						<td align="right">{if $config[useprice_required]}<span class="font_1">*</span>{/if}$config[useprice_title]：</td>
						<td><input type="text" name="review[price]" class="t_input" size="10" value="$detail[price]" />&nbsp;&nbsp;$config[useprice_unit]</td>
					</tr>
					<!--{/if}-->
					<!--{loop $config[taggroup] $val}-->
					<tr>
						<td align="right">$taggroups[$val][name]：</td>
						<!--{eval $detail_tags = $detail['taggroup'] ? @unserialize($detail['taggroup']) : array();}-->
						<td>
							<!--{if $taggroups[$val][sort]==1}-->
							<input type="text" name="review[taggroup][$val]" id="taggroup_$val" size="{if $_G[in_ajax]}35{else}50{/if}" class="t_input" value="{print @implode(',',$detail_tags[$val])}" />&nbsp;多个标签请用逗号","分开
							<!--{elseif $taggroups[$val][sort]==2}-->
							<!--{eval $tagconfig = explode(',', $taggroups[$val][options]);}-->
							<!--{loop $tagconfig $ky $tgval}-->
							<input type="checkbox" name="review[taggroup][$val][]" value="$tgval"{if (@in_array($tgval,$detail_tags[$val]))} checked{/if} id="taggroup_{$val}_{$ky}" /><label for="taggroup_{$val}_{$ky}">$tgval</label>&nbsp;
							<!--{/loop}-->
							<!--{/if}-->
						</td>
					</tr>
					<!--{/loop}-->
					<!--{if $ac == 'add' && (!$user->isLogin && $MOD[seccode_review_guest]) || ($user->isLogin && $MOD[seccode_review])}-->
					<tr>
						<td align="right"><span class="font_1">*</span>验证码：</td>
						<td><div id="seccode" style="float:left;"></div><input type="text" name="seccode" onfocus="show_seccode();" class="t_input" /></td>
					</tr>
					<!--{/if}-->
					<tr>
						<td></td>
						<td><label><input type="checkbox" name="review[hide_name]" value="1"{if $detail['hide_name']}checked="checked"{/if} />匿名点评</label></td>
					</tr>
					<tr>
						<td></td>
						<td>
							<div id="op_foot">
								{if $ac=='edit'}<input type="hidden" name="rid" value="$rid" />{/if}
								<!--{if $_G['in_ajax']}-->
								<input type="hidden" name="dosubmit" value="yes" />
								<button type="button" class="button" onclick="ajaxPost('frm_review', '', 'document_reload');">提交</button>&nbsp;&nbsp;
								<button type="reset" class="button">重置</button>
								<!--{else}-->
								<input type="hidden" name="forward" value="{print get_forward()}" />
								<button type="submit" name="dosubmit" value="yes">提交</button>&nbsp;&nbsp;
								<button type="reset">重置</button>&nbsp;&nbsp;
								<button type="button" onclick="history.go(-1);">返回</button>
								<!--{/if}-->
							</div>
						</td>
					</tr>
				</table>
				</form>
			<!--{/if}-->
			</div>
<!--{if !defined('IN_AJAX')}-->
		</div>
	</div>
	<div class="clear"></div>
</div>
<div class="mybottom"></div>
</div>
<!--{eval footer();}-->
<!--{/if}-->